﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SenerPro;

namespace MensUnoShop.Models
{
    public class NewsFactory
    {
        private static Logger _log = new Logger(Config.logpath);
        public static List<UNews> GetNewsList()
        {
            DBA.DBNews dbn = new DBA.DBNews();
            List<UNews> nlist = dbn.GetNewsList(true);
            return nlist;
        }

        public static List<UNews> GetNewsListAll()
        {
            DBA.DBNews dbn = new DBA.DBNews();
            List<UNews> nlist = dbn.GetNewsList(false);
            return nlist;
        }


        public static UNews GetNews(int nid)
        {
            DBA.DBNews dbn = new DBA.DBNews();
            UNews n = dbn.GetNews(nid);
            return n;
        }

        public static void ChangeNewsStatus(int nid)
        {
            DBA.DBNews dbn = new DBA.DBNews();
            dbn.ChangeNewsStatus(nid);
        }

        public static void UptNews(int id, string Ntitle, string Ncontent)
        {
            DBA.DBNews dbn = new DBA.DBNews();
            dbn.UptNews(id, Ntitle, Ncontent);
        }

        public static void AddNews(string Ntitle, string Ncontent)
        {
            DBA.DBNews dbn = new DBA.DBNews();
            dbn.AddNews(Ntitle, Ncontent);
        }

        internal static void DeleteNews(int nid)
        {
            DBA.DBNews dbn = new DBA.DBNews();
            dbn.DelNews(nid);
        }
    }
}